from fastapi import FastAPI
from pydantic import BaseModel, EmailStr
import uvicorn

app = FastAPI()


class UserIn(BaseModel):
    username: str
    password: str
    email: EmailStr
    full_name: str = None


class UserOut(BaseModel):
    username: str
    email: EmailStr
    full_name: str = None


@app.post("/user1/", response_model=UserOut)
async def create_user1(*, user: UserIn):
    return user


@app.post("/user2/", response_model=UserOut, response_model_exclude={'username'})
async def create_user2(*, user: UserIn):
    return user


@app.post("/user3/", response_model=UserOut, response_model_include={'email', 'full_name'})
async def create_user3(*, user: UserIn):
    return user


if __name__ == "__main__":
    uvicorn.run(app, host="0.0.0.0", port=8000)